package utils

import "encoding/json"

// CovertJson 把对象1转json转成对象2
func CovertJson(obj1, obj2 interface{}) error {
	bytes, err := json.Marshal(obj1)
	if err != nil {
		return err
	}
	err = json.Unmarshal(bytes, obj2)
	if err != nil {
		return err
	}
	return nil
}
